package cn.cc.code;
import java.text.SimpleDateFormat;
import java.util.*;

public class DateFormat {
    public static String format(Date date){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String format = sdf.format(date);
        return format;
    }
    public static void main(String[] args) {
        Date date = new Date();
        String time = format(date);
        System.err.println(time);
    }
}
